home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / MSDOS / (m)aan / CTUTOR2.ARC / READLINE.C < prev    next >
Text File  |  1986-05-27  |  384b  |  19 lines

  1. #include "stdio.h"
  2.  
  3. main()
  4. {
  5. FILE *fp1;
  6. char oneword[100];
  7. char *c;
  8.  
  9.    fp1 = fopen("TENLINES.TXT","r");
  10.  
  11.    do {
  12.       c = fgets(oneword,100,fp1); /* get one line from the file */
  13.       if (c != NULL)
  14.          printf("%s",oneword);    /* display it on the monitor  */
  15.    } while (c != NULL);          /* repeat until NULL          */
  16.  
  17.    fclose(fp1);
  18. }
  19.